package com.bytedance.article.common.a;

import android.os.Build;
import android.support.annotation.RequiresApi;
import android.view.Choreographer;

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
final class dd implements Choreographer.FrameCallback {
    private final MonitorFPS c;
    private long a;
    private int b;

    dd(MonitorFPS arg3) {
        this.c = arg3;
        this.a = -1;
        this.b = 0;
    }

    public final void doFrame(long arg8) {
        long v4 = 1000;
        if(this.a == -1) {
            this.a = arg8;
        }

        long v0 = arg8 - this.a;
        if(v0 > MonitorFPS.c().longValue()) {
            double v0_1 = (((double)((((long)this.b)) * v4 * v4))) / (((double)v0)) * (((double) MonitorFPS.d().longValue()));
            MonitorFPS.e();
            android.support.design.a.c(MonitorFPS.c(this.c), "fps", ((float)v0_1));
            MonitorFPS.d(this.c);
        }
        else {
            ++this.b;
            Choreographer.getInstance().postFrameCallback(this);
        }
    }
}

